//
//Circular Queue
// Created by Win10 on 2022/10/30.
//

#ifndef C_DATA_STRUCTURE_C_QUEUE_H
#define C_DATA_STRUCTURE_C_QUEUE_H

#define MaxSize 5

typedef int ElemType;

typedef struct {
    int front, rear;
    int size;
    ElemType data[MaxSize];
} CQueue;

void InitQueue(CQueue &Q);

bool QueueEmpty(CQueue Q);

bool QueueFull(CQueue Q);

bool EnQueue(CQueue &Q, ElemType x);

bool DeQueue(CQueue &Q, ElemType &x);

bool GetHead(CQueue Q, ElemType &x);

int GetSize(CQueue Q);  //返回队列元素的个数

#endif //C_DATA_STRUCTURE_C_QUEUE_H
